<?php
/* @var $this AppointmentController */
/* @var $model Appointment */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'appointment-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'service'); ?>
		<?php echo $form->dropDownList($model, 'service', CHtml::listData(
                Service::model()->findAll(), 'id', 'name'),             
                array('prompt' => 'Select a Service')
                ); ?>
		<?php echo $form->error($model,'service'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'date_time_appt'); ?>
		<?php yii::import('application.extensions.CJuiDateTimePicker.CJuiDateTimePicker');
            $this->widget('CJuiDateTimePicker',array(                
            'model'=>$model,
            'attribute'=>'date_time_appt',
            'mode'=>'datetime',
                        'language'=>'',                 
            'options'=>array(
                        "dateFormat"=>'yy/mm/dd',
                        'showAnim'=>'fold', // 'show' (the default), 'slideDown', 'fadeIn', 'fold'
                                'showOn'=>'button', // 'focus', 'button', 'both'
                
                                'buttonText'=>Yii::t('ui','Select form calendar'),
                                'buttonImage'=>Yii::app()->request->baseUrl.'/images/calendar.png',
                                'buttonImageOnly'=>true,
                        ),
                        'htmlOptions'=>array(
                        'style'=>'width:180px;vertical-align:top'
            )));
        ?>
		<?php echo $form->error($model,'date_time_appt'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'personnel'); ?>
		<?php echo $form->dropDownList($model, 'personnel', CHtml::listData(
            Personnel::model()->findAll(), 'id', 'first_name'),             
            array('prompt' => 'Select a Personnel')
        ); ?>
		<?php echo $form->error($model,'personnel'); ?>
	</div>

	<!--
	<div class="row">
		<?php echo $form->labelEx($model,'total_amount'); ?>
		<?php echo $form->textField($model,'total_amount',array('size'=>9,'maxlength'=>9)); ?>
		<?php echo $form->error($model,'total_amount'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'date_time_created'); ?>
		<?php echo $form->textField($model,'date_time_created'); ?>
		<?php echo $form->error($model,'date_time_created'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'customer'); ?>
		<?php echo $form->textField($model,'customer'); ?>
		<?php echo $form->error($model,'customer'); ?>
	</div>
	!-->

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->